﻿namespace = dvg_caladero

# War of Independence
dvg_caladero.1 = {
	type = country_event
	placement = ROOT

	title = dvg_caladero.1.t
	desc = dvg_caladero.1.d
	flavor = dvg_caladero.1.f
	
	event_image = {
		video = "gfx/event_pictures/southamerica_war_civilians.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/war_civilians"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
	}
	
	
	# Vive!
	option = {
		name = dvg_caladero.1.a
		default_option = yes
		add_journal_entry = {
			type = je_caladeran_war_of_independence
		}
		add_loyalists = {
			value = 0.3
			culture = cu:caladeran
		}
		set_capital = STATE_CUZCO
		ai_chance = {
			base = 1
		}
	}
}

# War of Independence Succeeds!
dvg_caladero.2 = {
	type = country_event
	placement = ROOT

	title = dvg_caladero.2.t
	desc = dvg_caladero.2.d
	flavor = dvg_caladero.2.f
	
	event_image = {
		video = "gfx/event_pictures/southamerica_aristocrats.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/aristocrats"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
	}
	
	
	# Vive!
	option = {
		name = dvg_caladero.2.a
		add_loyalists = {
			value = 0.1
		}
		add_journal_entry = {
			type = je_caladeran_pacify_quechua
		}
		set_capital = STATE_ECUADOR
		ai_chance = {
			base = 1
		}
	}
}

# War of Independence Fails!
dvg_caladero.3 = {
	type = country_event
	placement = ROOT

	title = dvg_caladero.3.t
	desc = dvg_caladero.3.d
	flavor = dvg_caladero.3.f
	
	event_image = {
		video = "gfx/event_pictures/southamerica_war_civilians.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/war_civilians"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
	}
	
	
	# Morir...
	option = {
		name = dvg_caladero.3.a
		add_radicals = {
			value = 0.1
		}
		add_radicals = {
			value = 0.4
			culture = cu:caladeran
		}
		set_capital = STATE_ECUADOR
		hidden_effect = {
			if = {
				limit = {
					NOT = { has_law = law_type:law_monarchy }
				}
				activate_law = law_type:law_monarchy
			}
		}
		ai_chance = {
			base = 1
		}
	}
}

# Quechua Land Rights?
dvg_caladero.4 = {
	type = country_event
	placement = ROOT

	title = dvg_caladero.4.t
	desc = dvg_caladero.4.d
	flavor = dvg_caladero.4.f

	event_image = {
		video = "gfx/event_pictures/unspecific_signed_contract.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/unspecific/signed_contract"

	icon = "gfx/interface/icons/event_icons/event_portrait.dds"

	duration = 3

	cooldown = { months = 4 }

	trigger = {
		cu:quechua = {
			culture_is_discriminated_in = ROOT
		}
		NOT = { has_modifier = dvg_quechua_land_rights }
		NOT = { has_modifier = dvg_quechua_no_land_rights }
	}

	option = { #no rights f**k you
		name = dvg_caladero.4.a
		add_radicals = {
			value = 0.6
			culture = cu:quechua
		}
		add_modifier = {
			name = dvg_quechua_no_land_rights
		}
		ai_chance = {
			base = 0.25
		}
	}
	option = { #give rights
		name = dvg_caladero.4.b
		default_option = yes
		add_radicals = {
			value = 0.2
			culture = cu:quechua
		}
		add_modifier = {
			name = dvg_quechua_land_rights
		}
		ai_chance = {
			base = 1
		}	
	}
}
		
# Quechua Rally
dvg_caladero.5 = {
	type = country_event
	placement = ROOT

	title = dvg_caladero.5.t
	desc = dvg_caladero.5.d
	flavor = dvg_caladero.5.f
	
	event_image = {
		video = "gfx/event_pictures/southamerica_war_civilians.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/war_civilians"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3
	
	cooldown = { months = 18 }

	trigger = {
	}
	
	
	# Oh dear
	option = {
		name = dvg_caladero.5.a
		default_option = yes
		add_radicals = {
			value = 0.05
			culture = cu:quechua
		}
		ai_chance = {
			base = 1
		}
	}
}

# QUECHUA PACIFIED
dvg_caladero.6 = {
	type = country_event
	placement = ROOT

	title = dvg_caladero.6.t
	desc = dvg_caladero.6.d
	flavor = dvg_caladero.6.f
	
	event_image = {
		video = "gfx/event_pictures/southamerica_war_civilians.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/war_civilians"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
	}
	
	
	#The issue is dealt with, for now.
	option = {
		name = dvg_caladero.6.a
		add_radicals = {
			value = 0.2
			culture = cu:quechua
		}
		ai_chance = {
			base = 1
		}
	}
}

# The Chinchasuyuan Revolt!
dvg_caladero.7 = {
	type = country_event
	placement = ROOT

	title = dvg_caladero.7.t
	desc = dvg_caladero.7.d
	flavor = dvg_caladero.7.f
	
	event_image = {
		video = "gfx/event_pictures/southamerica_war_civilians.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/aristocrats"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
	}
	
	immediate = {
		create_country = {
			tag = CCS
			origin = this
			state = s:STATE_CUZCO.region_state:QUI
			state = s:STATE_CUNTISUYU.region_state:QUI
			state = s:STATE_TIWANAKU.region_state:QUI
			state = s:STATE_NEAR_ANTISUYU.region_state:QUI
			state = s:STATE_ANTISUYU.region_state:QUI
			state = s:STATE_CHARCAS.region_state:QUI
			state = s:STATE_ATACAMA.region_state:QUI
			state = s:STATE_TILCARA.region_state:QUI
			state = s:STATE_NEW_CORNWALL.region_state:QUI
			state = s:STATE_STATE_COLLASUYU.region_state:QUI
		}
		random_country = {
			limit = {
				any_neighbouring_state = {
					owner = ROOT
				}
				is_country_type = unrecognized
			}
			save_scope_as = quechua_revolt_scope
		}
#		set_global_variable = {
#			name = dvg_quechua_revolt
#			value = yes
#		}
	}
	
	#This means war!
	option = {
		name = dvg_caladero.7.a
		default_option = yes
		create_diplomatic_play = {
			target_country = scope:quechua_revolt_scope
			war = yes
			type = dp_annex_war
		}
		add_radicals = {
			value = 0.2
			culture = cu:quechua
		}
		ai_chance = {
			base = 1
		}
	}
	
	#We have to accept this.
	option = {
		name = dvg_caladero.7.b
		add_radicals = {
			value = 0.2
			culture = cu:quechua
		}
		ai_chance = {
			base = 0
		}
	}
}

# The Southern Conquest!
dvg_caladero.8 = {
	type = country_event
	placement = ROOT

	title = dvg_caladero.8.t
	desc = dvg_caladero.8.d
	flavor = dvg_caladero.8.f
	
	event_image = {
		video = "gfx/event_pictures/southamerica_war_civilians.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/aristocrats"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
	}
	
	#Glorious!
	option = {
		name = dvg_caladero.8.a
		default_option = yes
		add_radicals = {
			value = 0.2
			culture = cu:quechua
		}
		s:STATE_CUZCO = { 
			add_homeland = caladeran
		}
		s:STATE_CUNTISUYU = { 
			add_homeland = caladeran
		}
		s:STATE_NEAR_ANTISUYU = { 
			add_homeland = caladeran
		}
		s:STATE_TIWANAKU = { 
			add_homeland = caladeran
		}
		s:STATE_ANTISUYU = { 
			add_homeland = caladeran
		}
        s:STATE_CHARCAS = { 
			add_homeland = caladeran
		}
        s:STATE_ATACAMA = { 
			add_homeland = caladeran
		}
        s:STATE_TILCARA = { 
			add_homeland = caladeran
		}
		add_journal_entry = {
			type = je_eliminate_inca
		}
		ai_chance = {
			base = 1
		}
	}
}

# La Destrucción
dvg_caladero.9 = {
	type = country_event
	placement = ROOT

	title = dvg_caladero.9.t
	desc = dvg_caladero.9.d
	flavor = dvg_caladero.9.f
	
	event_image = {
		video = "gfx/event_pictures/southamerica_war_civilians.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/aristocrats"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
	}
	
	#Glorious!
	option = {
		name = dvg_caladero.9.a
		default_option = yes
		add_radicals = {
			value = 0.2
			culture = cu:quechua
		}
		s:STATE_LIMA = { 
			remove_homeland = quechua
		}
        s:STATE_CAJAMARCA = { 
			remove_homeland = quechua
		}
        s:STATE_ECUADOR = { 
			remove_homeland = quechua
		}
        s:STATE_PASTAZA = { 
			remove_homeland = quechua
		}
        s:STATE_CAUCA = { 
			remove_homeland = quechua
		}
		ai_chance = {
			base = 1
		}
	}
}

# The Fate of New Toledo
dvg_caladero.10 = {
	type = country_event
	placement = ROOT

	title = dvg_caladero.10.t
	desc = dvg_caladero.10.d
	flavor = dvg_caladero.10.f
	
	event_image = {
		video = "gfx/event_pictures/southamerica_war_civilians.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/aristocrats"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
	}
	
	#As Is
	option = {
		name = dvg_caladero.10.a
		default_option = yes
		custom_tooltip = {
			text = dvg_caladero_as_is
			add_journal_entry = {
				type = je_caladeran_strike_southwards
			}
			set_variable = dvg_puna
			trigger_event = { id = dvg_caladero.12 days = 30 }
		}
		ai_chance = {
			base = 0.5
		}
	}
	
	#Manuel
	option = {
		name = dvg_caladero.10.b
		custom_tooltip = {
			text = dvg_caladero_manuel
			trigger_event = { id = dvg_caladero.11 days = 30 }
			set_variable = dvg_quito
		}
		ai_chance = {
			base = 0.5
		}
	}
}

# The Army Revolts
dvg_caladero.11 = {
	type = country_event
	placement = ROOT

	title = dvg_caladero.11.t
	desc = dvg_caladero.11.d
	flavor = dvg_caladero.11.f
	
	event_image = {
		video = "gfx/event_pictures/southamerica_war_civilians.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/aristocrats"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
	}
	
	#As Is
	option = {
		name = dvg_caladero.11.a
		default_option = yes
		custom_tooltip = {
			text = dvg_caladero_keep_manuel
			if = {
				limit = {
					NOT = { has_law = law_type:law_presidential_republic }
				}
				activate_law = law_type:law_presidential_republic
			}
			if = {
				limit = {
					NOT = { has_law = law_type:law_professional_army }
				}
				activate_law = law_type:law_professional_army
			}
			if = {
				limit = {
					NOT = { has_law = law_type:law_landed_voting }
				}
				activate_law = law_type:law_landed_voting
			}
			if = {
				limit = {
					NOT = { has_law = law_type:law_right_of_assembly }
				}
				activate_law = law_type:law_right_of_assembly
			}
			if = {
				limit = {
					NOT = { has_law = law_type:law_per_capita_based_taxation }
				}
				activate_law = law_type:law_per_capita_based_taxation
			}
			if = {
				limit = {
					NOT = { has_law = law_type:law_freedom_of_conscience }
				}
				activate_law = law_type:law_freedom_of_conscience
			}
			if = {
				limit = {
					NOT = { has_law = law_type:law_religious_schools }
				}
				activate_law = law_type:law_religious_schools
			}
			if = {
				limit = {
					NOT = { has_law = law_type:law_elected_bureaucrats }
				}
				activate_law = law_type:law_elected_bureaucrats
			}
			ig:ig_landowners = {
				remove_ideology = ideology_patriarchal
				add_ideology = ideology_republican_paternalistic
			}
			trigger_event = { id = dvg_caladero.14 days = 45 }
		}
		add_journal_entry = {
			type = je_caladeran_strike_southwards
		}
		ai_chance = {
			base = 1
		}
	}
	
	#Martin
	option = {
		name = dvg_caladero.11.b
		custom_tooltip = {
			text = dvg_caladero_martin
			create_character = {
				first_name = "Martin"
				last_name = "Ballivian"
				birth_date = 1795.10.24
				culture = cu:portuguese
				ruler = yes
				religion = catholic
				noble = yes
				interest_group = ig_landowners
				ideology = ideology_ethno_nationalist
				traits = { 
					bigoted 
					wrathful 
					ambitious
				}
			}
			if = {
				limit = {
					NOT = { has_law = law_type:law_autocracy }
				}
				activate_law = law_type:law_autocracy
			}
			add_journal_entry = {
				type = je_unite_caladero_with_granada
			}
			remove_variable = dvg_quito
		}
		ai_chance = {
			base = 0
		}
	}
}

# Liberal Revolution!
dvg_caladero.12 = {
	type = country_event
	placement = ROOT

	title = dvg_caladero.12.t
	desc = dvg_caladero.12.d
	flavor = dvg_caladero.12.f
	
	event_image = {
		video = "gfx/event_pictures/southamerica_war_civilians.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/aristocrats"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
	}
	
	#As Is
	option = {
		name = dvg_caladero.12.a
		default_option = yes
		ai_chance = {
			base = 0.5
		}
	}
	
	#Clodio!
	option = {
		name = dvg_caladero.12.b
		custom_tooltip = {
			text = dvg_caladero_clodio
			set_variable = dvg_quito
			remove_variable = dvg_puna
			ig:ig_landowners = {
				remove_ideology = ideology_patriarchal
				add_ideology = ideology_republican_paternalistic
			}
			if = {
				limit = {
					NOT = { has_law = law_type:law_parliamentary_republic }
				}
				activate_law = law_type:law_presidential_republic
			}
			if = {
				limit = {
					NOT = { has_law = law_type:law_national_militia }
				}
				activate_law = law_type:law_national_militia
			}
			if = {
				limit = {
					NOT = { has_law = law_type:law_census_voting }
				}
				activate_law = law_type:law_census_voting
			}
			if = {
				limit = {
					NOT = { has_law = law_type:law_right_of_assembly }
				}
				activate_law = law_type:law_right_of_assembly
			}
			if = {
				limit = {
					NOT = { has_law = law_type:law_per_capita_based_taxation }
				}
				activate_law = law_type:law_per_capita_based_taxation
			}
			if = {
				limit = {
					NOT = { has_law = law_type:law_freedom_of_conscience }
				}
				activate_law = law_type:law_freedom_of_conscience
			}
			if = {
				limit = {
					NOT = { has_law = law_type:law_public_schools }
				}
				activate_law = law_type:law_public_schools
			}
			if = {
				limit = {
					NOT = { has_law = law_type:law_elected_bureaucrats }
				}
				activate_law = law_type:law_elected_bureaucrats
			}
			if = {
				limit = {
					NOT = { has_law = law_type:law_interventionism}
				}
				activate_law = law_type:law_interventionism
			}
			trigger_event = { id = dvg_caladero.15 days = 45 }
		}
		ai_chance = {
			base = 0.5
		}
	}
}

# Caladero and Granada United!
dvg_caladero.13 = {
	type = country_event
	placement = ROOT

	title = dvg_caladero.13.t
	desc = dvg_caladero.13.d
	flavor = dvg_caladero.13.f
	
	event_image = {
		video = "gfx/event_pictures/southamerica_war_civilians.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/aristocrats"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
	}
	
	#Glorious! later put in event 14, which would bea  council between GCO and QUI
	option = {
		name = dvg_caladero.13.a
		default_option = yes
		add_journal_entry = {
			type = je_caladeran_strike_southwards
		}
		add_primary_culture = cu:granadan
		custom_tooltip = {
			text = dvg_martin_is_super_glad_tt
			set_variable = dvg_martin_is_super_glad
		}
		ai_chance = {
			base = 1
		}
	}
}

# Manuel Assumes Office
dvg_caladero.14 = {
	type = country_event
	placement = ROOT

	title = dvg_caladero.14.t
	desc = dvg_caladero.14.d
	flavor = dvg_caladero.14.f
	
	event_image = {
		video = "gfx/event_pictures/southamerica_war_civilians.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/aristocrats"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
	}
	
	#Manuel
	option = {
		name = dvg_caladero.14.a
		default_option = yes
		custom_tooltip = {
			text = dvg_caladero_manuel_direct_tt
			create_character = {
				first_name = "Manuel"
				last_name = "Sadino"
				birth_date = 1802.11.13
				culture = cu:portuguese
				ruler = yes
				religion = catholic
				interest_group = ig_petty_bourgeoisie
				ideology = ideology_republican_leader
				traits = { 
					innovative
					charismatic
					ambitious
				}
			}
		}
		ai_chance = {
			base = 1
		}
	}
}

# Clodio Assumes Office
dvg_caladero.15 = {
	type = country_event
	placement = ROOT

	title = dvg_caladero.15.t
	desc = dvg_caladero.15.d
	flavor = dvg_caladero.15.f
	
	event_image = {
		video = "gfx/event_pictures/southamerica_war_civilians.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/aristocrats"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {
	}
	
	#Clodio
	option = {
		name = dvg_caladero.15.a
		default_option = yes
		custom_tooltip = {
			text = dvg_caladero_clodio_direct_tt
			create_character = {
				first_name = "Clodio"
				last_name = "Magno_Puma_Muyuroney"
				birth_date = 1801.12.23
				culture = cu:caladeran
				ruler = yes
				religion = catholic
				noble = yes
				interest_group = ig_intelligentsia
				ideology = ideology_radical
				traits = { 
					innovative
					charismatic
					ambitious
				}
			}
		}
		ai_chance = {
			base = 1
		}
	}
}